﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using System.Web.UI.HtmlControls;

namespace relatorioGerenciais.VisualWebPart1
{
    public partial class VisualWebPart1UserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                SPWeb mySite = SPContext.Current.Web;
                SPList myList = mySite.Lists["relatoriosGerenciamento"];
                SPListItemCollection itemCollection = myList.Items;
            
                String varHTML = "";
                foreach (SPListItem item in itemCollection)
                {
                    varHTML += "<li><a href=" + item["URL"] + ">" + item["Title"] + "</a></li>";
                }
                HtmlGenericControl div = (HtmlGenericControl)this.Page.FindControl("divmap");
                divmap.InnerHtml = varHTML;
         }
        
    }
}
